﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace yafc.Interface.Api
{
	public delegate void ApiCall(ApiArgs Args);

	public class ApiArgs : EventArgs
	{
		public string username;
		public string password;

		public string authorization
		{
			get
			{
				return Convert.ToBase64String(UTF8Encoding.UTF8.GetBytes(
					username + ":" + password));
			}
		}
	}

	public class LoginArgs : ApiArgs
	{
		public LoginArgs(string Username, string Password)
		{
			username = Username;
			password = Password;
		}
	}

	public class TLArgs : ApiArgs
	{
		public int count = -1;
		public int page = -1;
		public string sinceId = null;
		public string maxId = null;
		public string format = null;

		public TLArgs(string Username, string Password)
		{
			username = Username;
			password = Password;
		}
		public TLArgs(string Username, string Password, string MaxId)
		{
			username = Username;
			password = Password;
			maxId = MaxId;
		}
	}

	public class SendArgs : ApiArgs
	{
		public string text = null;
		public string replyId = null;
		public string srcId = null;
		public string location = null;

		public SendArgs(string Username, string Password, string Message)
		{
			username = Username;
			password = Password;
			text = Message;
		}
		public SendArgs(string Username, string Password, string Message,
			string ReplyId)
		{
			username = Username;
			password = Password;
			text = Message;
			replyId = ReplyId;
		}
		public SendArgs(string Username, string Password, string Message,
			string ReplyId, string Location)
		{
			username = Username;
			password = Password;
			text = Message;
			replyId = ReplyId;
			location = Location;
		}
	}
}
